package com.hongye.house.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hongye.common.utils.PageUtils;
import com.hongye.common.utils.Query;

import com.hongye.house.dao.PropertiesSaleHomeDao;
import com.hongye.house.entity.PropertiesSaleHomeEntity;
import com.hongye.house.service.PropertiesSaleHomeService;


@Service("propertiesSaleHomeService")
public class PropertiesSaleHomeServiceImpl extends ServiceImpl<PropertiesSaleHomeDao, PropertiesSaleHomeEntity> implements PropertiesSaleHomeService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PropertiesSaleHomeEntity> page = this.page(
                new Query<PropertiesSaleHomeEntity>().getPage(params),
                new QueryWrapper<PropertiesSaleHomeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<PropertiesSaleHomeEntity> hotSaleHome() {
        return this.baseMapper.selectList(new QueryWrapper<PropertiesSaleHomeEntity>().orderByAsc("properties_sort"));
    }

}